import request from '@/utils/request'

// 获取商品列表
export function fetchGoodList(params) {
    return request({ url: '/getGoodList', method: 'GET', params })
}

// 获取品类列表
export function fetchCateList(params) {
    return request({ url: '/getCateList', method: 'GET', params })
}

// 获取商品详情页
export function fetchGoodInfo(params) {
    return request({ url: '/getGoodInfo', method: 'GET', params })
}

// 登录
export function fetchLogin(data) {
    return request({ url: '/login', method: 'POST', data })
}

// 注册
export function fetchRegist(data) {
    return request({ url: '/regist', method: 'POST', data })
}

// 加入购物车
export function fetchCartAdd(data) {
    return request({ url: '/addToCart', method: 'POST', data })
}

// 查询购物车列表
export function fetchCartList(params) {
    return request({ url: '/getCartList', method: 'GET', params })
}

// 更新购物车商品数量
export function fetchCartUpd(params) {
    return request({ url: '/Cartupd', method: 'GET', params })
}

// 删除购物车商品
export function fetchCartDel(params) {
    return request({ url: '/Cartdel', method: 'GET', params })
}

// 提交购物车信息
export function fetchCartSubmit(data) {
    return request({ url: '/Cartsubmit', method: 'POST', data })
}

// 获取用户信息
export function fetchUserInfo(params) {
    return request({ url: '/getUserInfo', method: 'GET', params })
}

export default {
    fetchGoodList,
    fetchCateList,
    fetchGoodInfo,
    fetchLogin,
    fetchRegist,
    fetchCartAdd,
    fetchCartList,
    fetchCartUpd,
    fetchCartDel,
    fetchCartSubmit,
    fetchUserInfo
}